package visualizer.drawable.concrete;

import processing.core.PGraphics;
import processing.core.PImage;
import visualizer.drawable.AbstractDrawable;

public class LoadingScreen extends AbstractDrawable {
	
	private PImage loading;
	private int background;
	private float rotating = 0;
	
	public LoadingScreen(PImage loading)
	{
		this.loading = loading;
		loading.loadPixels();
		this.background = loading.pixels[0];
	}
	
	public void draw(PGraphics g) {
		g.noStroke();
		g.smooth();
		
		g.imageMode(g.CENTER);
		g.pushMatrix();
		g.translate(g.width/2, g.height/2+100);
		
//		g.rectMode(g.CENTER);
//		g.fill(background);
//		g.rect(0, 0, 2000,300);
		
		rotating += (float) (Math.PI/90);
		g.rotate(rotating);
		g.image(this.loading, 0, 0, 200, 200);
		g.popMatrix();
	}
}
